package com.young.springdemo.service.commandchain;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

@Service
public class testCommand {


//    @PostConstruct
    public void testCommand(){
        Approve zhagnwuji,zhangcuishan,zhangsanfeng;
        zhagnwuji = new Director("张无忌");
        zhangcuishan = new VicePrident("张翠山");
        zhangsanfeng = new President("张三丰");

        //創建
        zhagnwuji.setApprove(zhangcuishan);
        zhangcuishan.setApprove(zhangsanfeng);

        PurchaseRequest purchaseRequest = new PurchaseRequest("小二叔",100,"看书");
        PurchaseRequest jian = new PurchaseRequest("倚天剑",400,"练剑");

        PurchaseRequest dao = new PurchaseRequest("屠龙刀",800,"镰刀");


        zhagnwuji.processRequest(purchaseRequest);

        zhagnwuji.processRequest(jian);
        zhagnwuji.processRequest(dao);

    }


}
